<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="NewsListServlet" method="post">
    <input type="text" placeholder="请输入搜索关键字" name="keyword" size="50" value="${keyword}"> <input type="submit" value="搜">
</form>


<table id="tbnews" border="1">
    <tr>
        <th>编号</th>
        <th>标题</th>
        <th>所属版块</th>
        <th>发布时间</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${newsList}" var="n">
        <tr>
            <td>${n.newsid}</td>
            <td>${n.title}</td>
            <td>${n.block.blockName}</td>
            <td>${n.writeTime}</td>
            <td><a href="">修改</a>| <a href="">删除</a></td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="5" align="center">
            <a href="NewsListServlet?pageIndex=1&keyword=${keyword}">首页</a>|
            <a href="NewsListServlet?pageIndex=${pageIndex-1}&keyword=${keyword}">上一页</a>|
            <a href="NewsListServlet?pageIndex=${pageIndex+1}&keyword=${keyword}">下一页</a>|
            <a href="NewsListServlet?pageIndex=${totalPages}&keyword=${keyword}">尾页</a>
        </td>
    </tr>

</table>

</body>
</html>
